Skip to content

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 11, 2024

This PR reworks method probing to use fulfillment instead of a for-loop of evaluate_predicate calls, and moves normalization from method candidate assembly into the consider_probe, where it's applied to all candidates. This last part coincidentally fixes #121643 (comment).

Regarding why this large rewrite is done: In general, it's an anti-pattern to do for o in obligations { evaluate(o); } because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

r? lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 11, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 11, 2024

Some changes occurred in engine.rs, potentially modifying the public API of ObligationCtxt.

cc @lcnr, @compiler-errors

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Mar 11, 2024

⌛ Trying commit 3702ab1 with merge 1f75533...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 11, 2024
…, r=<try>

Use fulfillment in method probe, not evaluation

This PR reworks method probing to use fulfillment instead of a `for`-loop of `evaluate_predicate` calls, and moves normalization from method candidate assembly into the `consider_probe`, where it's applied to *all* candidates. This last part coincidentally fixes rust-lang#121643 (comment).

Regarding *why* this large rewrite is done: In general, it's an anti-pattern to do `for o in obligations { evaluate(o); }` because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

Putting this up for vibe-check mostly. Tests aren't yet blessed, and there are some nuances about whether it's worthwhile to restore regressed diagnostics.

r? lcnr
@bors
Copy link
Collaborator

bors commented Mar 11, 2024

☀️ Try build successful - checks-actions
Build commit: 1f75533 (1f7553361c08f8eafdc645e09215667278ab86f4)

@compiler-errors
Copy link
Member Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-122317 created and queued.
🤖 Automatically detected try build 1f75533
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 11, 2024
@compiler-errors compiler-errors mentioned this pull request Mar 14, 2024
4 tasks
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2024
Crater rollup

This is a crater rollup of:

- [ ] rust-lang#122317
- [ ] rust-lang#122501
- [ ] rust-lang#122077

What does that mean? Well, I'm gonna run crater with p=3 on this PR, and then re-run *just* the list of failed crates on each PR. That should deduplicate the bulk of crates which we expect are unaffected by these PRs.

Don't touch this PR please.

r? `@ghost`
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2024
Crater rollup

This is a crater rollup of:

- [ ] rust-lang#122317
- [ ] rust-lang#122501
- [ ] rust-lang#122077

What does that mean? Well, I'm gonna run crater with p=3 on this PR, and then re-run *just* the list of failed crates on each PR. That should deduplicate the bulk of crates which we expect are unaffected by these PRs.

Don't touch this PR please.

r? `@ghost`
@compiler-errors
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Mar 14, 2024

⌛ Trying commit 35d6003 with merge 3aea706...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2024
…, r=<try>

Use fulfillment in method probe, not evaluation

This PR reworks method probing to use fulfillment instead of a `for`-loop of `evaluate_predicate` calls, and moves normalization from method candidate assembly into the `consider_probe`, where it's applied to *all* candidates. This last part coincidentally fixes rust-lang#121643 (comment).

Regarding *why* this large rewrite is done: In general, it's an anti-pattern to do `for o in obligations { evaluate(o); }` because it's not compatible with the way that the new solver emits alias-relate obligations which constrain variables that may show up in other predicates.

Putting this up for vibe-check mostly. Tests aren't yet blessed, and there are some nuances about whether it's worthwhile to restore regressed diagnostics.

r? lcnr
@bors
Copy link
Collaborator

bors commented Mar 15, 2024

☀️ Try build successful - checks-actions
Build commit: 3aea706 (3aea7069a654d82dd39c4479794b5560f4977307)

1 similar comment
@bors
Copy link
Collaborator

bors commented Mar 15, 2024

☀️ Try build successful - checks-actions
Build commit: 3aea706 (3aea7069a654d82dd39c4479794b5560f4977307)

@craterbot
Copy link
Collaborator

🚧 Experiment pr-122317 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-122317 is completed!
📊 34 regressed and 1 fixed (425628 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Mar 20, 2024
@lcnr
Copy link
Contributor

lcnr commented Apr 23, 2024

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Apr 23, 2024

📌 Commit 8995c2c has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2024
@bors
Copy link
Collaborator

bors commented Apr 23, 2024

⌛ Testing commit 8995c2c with merge cd90d5c...

@bors
Copy link
Collaborator

bors commented Apr 23, 2024

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing cd90d5c to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cd90d5c): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.2%, 1.3%] 38
Regressions ❌
(secondary)
4.2% [0.5%, 23.6%] 39
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.2%, 1.3%] 38

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.4% [-1.4%, -1.4%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.5% [1.3%, 1.6%] 2
Regressions ❌
(secondary)
6.7% [2.1%, 25.2%] 23
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.3%, 1.6%] 2

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Bootstrap: 673.699s -> 674.88s (0.18%)
Artifact size: 316.17 MiB -> 316.16 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 23, 2024
@compiler-errors
Copy link
Member Author

checking perf in #124303

@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Apr 29, 2024
@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Apr 29, 2024
@Mark-Simulacrum
Copy link
Member

Marking this as triaged -- looks like attempts were made to improve performance in #124303 but did not pan out. The regressions are mostly pretty small with the exception of a stress test for exactly(?) this code.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 14, 2024
…=<try>

Relate receiver invariantly in method probe for `Mode::Path`

Reverts rust-lang#126128
Fixes the part of rust-lang#122317 which always used subtyping instead of eq
Fixes rust-lang#126227 (TODO: test)

WIP: description

r? lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trait methods can't be found by method resolution if the self type involves projections
10 participants